//
//  XGCarGroup.m
//  XGNotifyJump
//
//  Created by 小果 on 16/8/22.
//  Copyright © 2016年 小果. All rights reserved.
//

#import "XGCarGroup.h"
#import "XGCarModel.h"
@implementation XGCarGroup

-(instancetype)initWithDict:(NSDictionary *)dict
{
    if(self = [super init]){
        
        self.title = dict[@"title"];
        NSArray *dictArray = dict[@"cars"];
        NSMutableArray *carArray = [NSMutableArray array];
        for (NSDictionary *dict in dictArray) {
            XGCarModel *car = [XGCarModel carWithDict:dict];
            [carArray addObject:car];
        }
        self.cars = carArray;
    }
    return self;
}

+(instancetype)carGroupWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}

@end
